package util
{

    /**
     * 随机数 
     * @author Ryan
     * 
     */	
    public class MathTool 
    {
        /**
         * 返回两数之间随机整数 
         * @param num1
         * @param num2
         * @return 
         * 
         */
        public static function randRange(num1:int, num2:int) : int
        {
            var result:int = Math.floor(Math.random() * (num2 - num1 + 1)) + num1;
            return result;
        }
		
		/**
		 * 计算两点之间的距离 
		 */		
		public static function distance(x1:Number,y1:Number,x2:Number,y2:Number) : Number
		{
			var dx:Number = x1 - x2;
			var dy:Number = y1 - y2;
			var result:Number = Math.sqrt(dx*dx + dy* dy);
			return result;
		}
    }
}
